﻿<Window x:Class="WMSSoft.WinKStart.Settings"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:usercontrols="clr-namespace:WMSSoft.WinKStart.UserControls"
        xmlns:ViewModel="clr-namespace:WMSSoft.WinKStart.ViewModel"
        x:Name="SettingsWindow"
        Title="{Binding ViewName}" Height="394" Width="672" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Icon="/WinKStart;component/grfx/preferences-other.png" WindowStyle="ToolWindow">
    <Window.Resources>
        <DataTemplate DataType="{x:Type ViewModel:CWinKStartBehaviorViewModel}">
            <usercontrols:WinKStartBehavior />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CWinKStartStartButtonViewModel}">
            <usercontrols:WinKStartStartButton />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CWinKStartContextMenuViewModel}">
            <usercontrols:WinKStartContextMenu />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CContentActionsViewModel}">
            <usercontrols:ContentActions />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CContentContextMenuViewModel}">
            <usercontrols:ContentContextMenu />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CContentRegionsViewModel}">
            <usercontrols:ContentRegions />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CModulesDataSourceViewModel}">
            <usercontrols:ModulesDataSource />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CModulesFunctionViewModel}">
            <usercontrols:ModulesFunction />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CModulesEnginesViewModul}">
            <usercontrols:ModulesEngines />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CModulesStylesViewModel}">
            <usercontrols:ModulesStyle />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CModulesLanguageViewModel}">
            <usercontrols:ModulesLanguage />
        </DataTemplate>
        <DataTemplate DataType="{x:Type ViewModel:CAboutViewModel}">
            <usercontrols:About />
        </DataTemplate>
        <!--<ResourceDictionary Source="SettingsRessources.xaml"/>-->
    </Window.Resources>
    <Grid Margin="10,10,4,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="280"/>
            <RowDefinition Height="36"/>
            <RowDefinition Height="59"/>
            <RowDefinition Height="0"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" MinWidth="180"/>
            <ColumnDefinition Width="66*"/>
            <ColumnDefinition Width="397*"/>
        </Grid.ColumnDefinitions>
        <Label Content="{Binding CategoryCaption}" VerticalAlignment="Top" BorderBrush="#FF828790" BorderThickness="1" FontWeight="Bold" Height="24" Margin="0" Padding="5,2"/>
        <Label Content="{Binding CurrentPathName}" Grid.Column="1" Margin="5,0,4,0" VerticalAlignment="Top" Grid.ColumnSpan="2" Padding="5,2" Height="24" FontWeight="Bold" BorderThickness="1" BorderBrush="#FF828790"/>
        <TreeView HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="1" ItemsSource="{Binding SettingOptions}" SelectedItemChanged="TreeView_SelectedItemChanged">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Items}">
                    <TextBlock Text="{Binding ViewName}" FontWeight="{Binding Weight}" />
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
        <ContentControl Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="1" Content="{Binding Path=CurrentOptionsDetailViewModel}" />
        <StackPanel Grid.Column="2" Grid.Row="2"  Orientation="Horizontal" FlowDirection="RightToLeft">
            <Button Content="{Binding Discard.ViewName}" HorizontalAlignment="Right" Margin="0,5,3,5" VerticalAlignment="Top" Width="100" Height="23" Command="{Binding Discard.Command}" CommandParameter="{Binding ElementName=SettingsWindow}"/>
            <Button Content="{Binding Apply.ViewName}" HorizontalAlignment="Right" Margin="10,5,0,5" VerticalAlignment="Top" Width="100" Height="23" Command="{Binding Apply.Command}" CommandParameter="{Binding ElementName=SettingsWindow}"/>            
        </StackPanel>
    </Grid>
</Window>
